% Normalize an index based on the ?(x) -> ?'(x) rule in problem 15
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function normalizedIndex = alphaNormalize(index,varargin);
%  
%   This function will normalize a given input index (e(x), Id(x), we(x),
%   or Idw(x) according to the following normalizing rule of
%
%                              (?(x) - min ?)
%            ?(x) -> ?'(x) =  ----------------
%                             (max ? - min ?)
%
%   INPUTS:     index - index ?(x) to normalize
%               
%   OUTPUTS:    normalizedIndex - normalized index ?'(x)           
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function normalizedIndex = alphaNormalize(index,varargin);

% A few variable initializations
[temp indexLength]=size(index);
normalizedIndex = zeros(temp, indexLength);

% Now we normalize ?(x) to ?'(x)
for x = 1:indexLength
    normalizedIndex(x) = (index(x) - min(index))/(max(index) - min(index));
end;
